package com.ddf.controller;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.ddf.entity.User;

@Controller
@RequestMapping("/ConverServiceDemo")
public class ConverServiceDemo {
	private Logger log = LoggerFactory.getLogger(this.getClass());
	/**
	 * 页面传过来的是String类型经过转换之后，可以直接用User对象来入参
	 * @param user
	 */
	@RequestMapping("/testUserConversionDemo")
	public String TestUserConversionDemo(@RequestParam User user, Map<String, User> map) {
		if(user != null && !"".equals(user)) {
			log.info(user.toString());
			map.put("user", user);
		}
		return "success";
	}
}
